<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
      
    </style>
</head>

<body>
    <div id="app">
       <div v-color="'red'">这是一个标题</div>
       <div v-rapper="'尤雨溪 repper'"></div>
    </div>

    <script src="./js/axios.js"></script>
    <script src="./js/vue@3.5.13.js"></script>
    <script>
        const{ createApp , onMounted , ref } = Vue 
        const app = createApp({
            setup(){
                return{}
            }
        })
        app.directive('color',{
            // el 获取dom元素
            mounted(el, binding){
                el.style.color = binding.value
                el.style.fontWeight = 'bolder'
            }
        })
        app.directive('rapper',{
            mounted(el,binding){
                el.innerText = binding.value
            }
        })

        .mount("#app")//挂载容器(最后)

        
    </script>
</body>
</html>